<template>
  <view class="my-search-container" :style="{'background-color':bgcolor}">
    <view class="my-search-box" :style="{'border-radius':radius+'px'}" @click="searchBoxHandler">
      <uni-icons type="search" size="17"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    props:{
      bgcolor:{
        default:'#E16531',
        type:String
      },
      radius:{
        type:Number,
        default:18
      }
    },
    data() {
      return {
        searchBoxHandler(){
          this.$emit('click')
        }
      };
    }
  }
</script>

<style lang="scss">
.my-search-container{
  position: relative;
  height: 50px;
  // background-color: #E16531;
  .my-search-box{
    position: absolute;
    top:50%;
    left: 50%;
    width: 96%;
    // border-radius: 18px;
    line-height: 36px;
    background-color: #fff;
    text-align: center;
    transform: translate(-50%,-50%);
  }
}
</style>
